home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 497 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  70 lines

  1. Newsgroups: comp.lang.c++
  2. Path: ramanujn.unx.sas.com!sasrag
  3. From: sasrag@ramanujn.unx.sas.com (Russell Gonsalves)
  4. Subject: Rogue Wave bug? / How buggy is Rogue Wave?
  5. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  6. Message-ID: <DKo7KB.6KL@unx.sas.com>
  7. Date: Thu, 4 Jan 1996 19:02:35 GMT
  8. X-Nntp-Posting-Host: ramanujn.unx.sas.com
  9. Organization: SAS Institute Inc.
  10.  
  11. /*
  12.  
  13. Here's the program to try:
  14.  
  15. The bug?
  16.  
  17. It seems to badly handle null-strings.  The last
  18. print still prints yy.  While test.isNull() is
  19. aware that the string is a null-terminated string,
  20. such a RWCString cast to const char * does not
  21. point to "".  This appears to defeat the otherwise
  22. seamless and elegant conversion between RWCStrings
  23. and character pointers.
  24.  
  25. If you have RW could you try this out, and tell
  26. me if your version produces similar results.
  27.  
  28. What are your experiences with this library.  We've
  29. just started to use it, and quite frankly I'm a
  30. little surprised by this bug.
  31.  
  32. */
  33.  
  34.  
  35. #include <iostream.h>
  36. #include <rw/cstring.h>
  37.  
  38. static void print(const char * p)
  39. {
  40.    cout << "String:\"" << p << "\"" << endl;
  41. }
  42.  
  43. main()
  44. {
  45.    RWCString test;
  46.  
  47.    test = "abc";
  48.    print(test);
  49.    test = "xyz";
  50.    print(test);
  51.    test = "yy";
  52.    print(test);
  53.    test = "";
  54.    print(test);
  55. }
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. -- 
  65.  
  66.  
  67. Russell Gonsalves                                    sasrag@unx.sas.com
  68. IDE Department,                                      +1 919 6778000 x7702
  69. R2280, SAS Institute, Cary, NC 27513  USA
  70.